<?php
	require_once('class/LoaiSanPhamDAO.php');
	$maGH = $_REQUEST['maGianHang'];
	$lstLoaiSP = LoaiSanPhamDAO::LayDanhSachLoaiSanPhamTheoMaGianHang($maGH);
	//danh mục sản phẩm
	$danhMucSanPham = '<select name="selectDanhMucSanPham" id="selectDanhMucSanPham">
                    <option value="0">Tất cả danh mục</option>';
					if(count($lstLoaiSP)>0)
					{
						foreach($lstLoaiSP as $loaiSP)
						{
							$maLoaiSP = $loaiSP->MaLoaiSP;
							$tenLoaiSP = $loaiSP->TenLoaiSP;
							$danhMucSanPham .= ' <option value="'.$maLoaiSP .'">'.$tenLoaiSP .'</option>';
						}
					}
    $danhMucSanPham .= '</select>';
	
	$btnTimKiemSP = '<input name="txtTimKiemSP" type="button" value="Tìm kiếm" class="ui-state-default ui-state-hover" onclick="funcTimKiemSP_GianHang(0,'.$maGH .')"/> ';
	
	$btnTimKiemSPMoRong = '<input name="txtTimKiemMoRongSP" type="button" value="Tìm kiếm mở rộng" class="ui-state-default ui-state-hover" onclick="funcTimKiemSP_GianHang(1,'.$maGH .')"/> ';
?>

<div class="search-product-wrapper">
    <div class="search-product">
        <form id="frmTimKiemSanPham" name="frmTimKiemSanPham" method="post" action="">
            <div class="content">                      
                <label for="txtTenSanPham_TimKiem">Tên sản phẩm:</label>
                <input name="txtTenSanPham_TimKiem" type="text" title="*Tên sản phẩm" size="20" maxlength="50" id="txtTenSanPham_TimKiem"/>
                
                <?php echo $danhMucSanPham; ?>
                
                <label for="txtGiaSPTu">Giá sản phẩm từ:</label>
                <input name="txtGiaSPTu" style="text-align:right" type="text" title="*0 VND" size="10" maxlength="20" id="txtGiaSPTu"/>
                
                <label for="txtGiaSPDen">đến:</label>
                <input name="txtGiaSPDen" style="text-align:right" type="text" title="*0 VND" size="10" maxlength="20" id="txtGiaSPDen"/>
                
                <?php echo $btnTimKiemSP ?>                         
            </div>
            
            <div class="option">
                <table width="100%" border="0" cellspacing="0" cellpadding="5">
                  <tr>
                    <td width="30%" align="right">
                    	<label for="dtpNgayDangSP_Tu">Ngày đăng từ ngày:</label>
                    </td>
                    <td width="70%">
                        <input name="dtpNgayDangSP_Tu"  id="dtpNgayDangSP_Tu" type="text" size="20" maxlength="20"/>
                        <label for="txtDenNgay">đến ngày:</label>
                        <input name="txtDenNgay" type="text" id="dtpNgayDangSP_Den"   size="20" maxlength="20"/>
                    </td>
                  </tr>
                  <tr>
                    <td align="right">
                    	<label for="txtGiamGiaTu">Được giảm giá từ:</label>
                    </td>
                    <td>
                    	<input name="txtGiamGiaTu" style="text-align:right;" type="text" title="*0 %" size="15" maxlength="20" id="txtGiamGiaTu"/>
                    	<label for="txtGiamGiaDen">đến :</label>
                        <input name="txtGiamGiaDen" style="text-align:right;"  type="text" title="*0 %" size="15" maxlength="20" id="txtGiamGiaDen"/></td>
                  </tr>
                  <tr align="center">
                    <td colspan="2">                             
                       <?php echo $btnTimKiemSPMoRong; ?>
                    </td>
                  </tr>
                </table>
            </div>
         </form>
        <div class="footer">
            <a href="#" id="idTimMoRongSP">Tìm mở rộng <img src="image/button_open.png" width="10" height="10" /></a>
            </div>
    </div>
    <!--end .search-product-->
</div>